package com.lx.shiro.model;

import java.util.HashMap;

import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA
 *
 * @Author yuanhaoyue swithaoy@gmail.com
 * @Description 接口返回对象
 * @Date 2018-03-17
 * @Time 22:25
 */
@Component
public class ResultMap extends HashMap<String, Object> {
	public ResultMap() {
	}

	public ResultMap success() {
		this.put("result", "success");
		return this;
	}

	public ResultMap fail() {
		this.put("result", "fail");
		return this;
	}

	public ResultMap message(Object message) {
		this.put("message", message);
		return this;
	}

	public ResultMap code(int code) {
		this.put("code", code);
		return this;
	}

}
